import allure
from appium.webdriver.common.appiumby import AppiumBy

from base.wework_app import Wework
from page.address_list_page import AddressListPage


class MainPage(Wework):
    """
    企业微信主页
    """

    # 通讯录按钮
    _address_list_btn = (AppiumBy.XPATH, "//*[@text='通讯录']")

    @allure.step("点击通讯录按钮，跳转到通讯录页面")
    def goto_address_list(self):
        """
        跳转到通讯录页面
        :return: AddressListPage
        """
        self.find_ele(self._address_list_btn).click()

        return AddressListPage(self.driver)
